Package excel.copyandmove

Source Code of excel.copyandmove.AsposeCopySheetWithinWorkbook

package excel.copyandmove;

import com.aspose.cells.Workbook;
import com.aspose.cells.WorksheetCollection;

public class AsposeCopySheetWithinWorkbook
{
  public static void main(String[] args) throws Exception
  {
    //Create a new Workbook by excel file path
    Workbook wb = new Workbook();
   
    //Create a Worksheets object with reference to the sheets of the Workbook.
    WorksheetCollection sheets = wb.getWorksheets();
   
    //Copy data to a new sheet from an existing
    //sheet within the Workbook.
    sheets.addCopy("Sheet1");

    //Save the excel file.
    wb.save("data/AsposeCopyWorkbook.xls");
   
    System.out.println("Sheet copied successfully."); // Print Message
  }
}
TOP

Related Classes of excel.copyandmove.AsposeCopySheetWithinWorkbook

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.